#include "StdAfx.h"
#include "InstanceTackable.h"

namespace inst{

	MyTypeInfo::~MyTypeInfo(){}

	////0: get, 1:auto create, 2: delete
	AllInstType* Insts(int flag){
		static AllInstType* insts = 0;
		switch(flag){
		case 1:
			if(!insts){
				insts = new AllInstType();
			}
			break;
		case 2:
			if(insts){
				insts->clear();
				delete insts;
				insts = 0;
			}
			break;
		}
		return insts;
	}


	void Remove(void* t){
		AllInstType* all = Insts(0);
		if(all){
			all->erase(t);
			if(all->size() == 0){
				Insts(2);
			}
		}
	}

};